package com.k.ServiceImport;

import java.util.HashMap;
import java.util.Map;

import org.k.Dao.GenericDao;
import org.k.ServiceImpl.BaseServiceImpl;

import com.k.Model.Login;
import com.k.Service.LoginService;

//public class LoginServiceImport extends BaseServiceImpl<Login> implements LoginService {
public class LoginServiceImport extends org.k.ServiceImpl.GenericServiceImpl<Login,Integer> implements LoginService {
	private GenericDao<Login,Integer> logindao;
	
	@Override
	protected GenericDao<Login,Integer> getDAO() {
		return logindao;
	}

	public GenericDao<Login,Integer> getLogindao() {
		return logindao;
	}
	
	public void setLogindao(GenericDao<Login,Integer> loginDao) {
		this.logindao = loginDao;
	}
	
	public Login login(String username,String password){
		String hql="from Login where username=:userName and password=:passWord";
		Map map=new HashMap();
		map.put("userName", username);
		map.put("passWord", password);
		return this.logindao.findObj(hql, map);
	}
}
